package com.woniuxy.lrz.carlproject.dao;

import com.woniuxy.lrz.carlproject.model.Shop;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.lrz.carlproject.service.dto.ShopDto.ShopListDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 门店表 Mapper 接口
 * </p>
 *
 * @author lrz
 * @since 2022-09-28
 */
public interface ShopMapper extends BaseMapper<Shop> {

    @Select("select s.shop_id,s.shop_name,s.shop_phone,s.shop_address from shop s right join shop_service js on s.shop_id=js.shop_id where js.service_id=#{serviceId} and s.status='OPEN'")
    List<ShopListDto>  getShopById(@Param("serviceId") Integer serviceId);

}
